<template>
	<view class="ok">
		<block v-if="!boxHide">
			<image :src="info.free_status == 0 ? '/static/images/accessories_icon1.png' : '/static/images/accessories_icon2.png'" class="info_logo"></image>
			<view class="info_title">{{info.free_status == 0 ? "支付成功" : "免费服务"}}</view>
			<view class="info_time">时间：<text>{{info.create_at}}</text></view>
			<view class="info_box" v-if="info.free_status == 0">
				<view class="font_item w160">
					<view>支付金额</view><view>¥{{info.payment}}</view>
				</view>
				<view class="font_item w160">
					<view>支付方式</view><view>{{info.free_status == 0 ? "微信支付" :"其他支付"}}</view>
				</view>
				<view class="font_item w160">
					<view>支付时间</view><view>{{info.pay_time}}</view>
				</view>
			</view>
			
			<view class="info_box">
				<view class="font_item w120">
					<view>名称</view><view>{{info.title == null ? "-" : info.title}}</view>
				</view>
				<view class="font_item w120">
					<view>编号</view><view>{{info.number == null ? "-" : info.number}}</view>
				</view>
				<view class="font_item w120">
					<view>数量</view><view>{{info.stock}}</view>
				</view>
				<!-- <view class="font_item w120">
					<view>库房</view><view>{{info.warehouse}}</view>
				</view> -->
				<view class="font_item w120">
					<view>日期</view><view>{{info.create_at}}</view>
				</view>
			</view>
			<view class="save" @tap="navBack()">确认</view>
		</block>
		<Loading ref="load"></Loading>
	</view>
</template>

<script>
	import Loading from "../../../components/loading/loading.vue"
	export default{
		data(){
			return{
				boxHide:true,
				info:{}
			}
		},
		onLoad(options) {
			this.$refs.load.initLoading({loadType:1,loadPrompt:false}).then(res =>{
				this.boxHide = false
				this.$api.getAccessoriesInfo({id:options.id}).then(res => {
					this.info = res;
					this.$refs.load.getLoadingData({})
				})
			})
		},
		methods:{
			navBack(){
				uni.navigateBack({})
			}
		}
	}
</script>

<style>
	.ok{width: 100%;padding-bottom: 50upx;background: #FFFFFF;}
	.info_logo{width: 143upx;height: 143upx;margin: 100upx 0 0 304upx;}
	.info_title{text-align: center;margin-top: 30upx;font-size: 36upx;color: #333333;}
	.info_time{font-size: 28upx;color: #999999;text-align: center;padding-bottom: 30upx;margin-top: 10upx;}
	.info_time text{color: #333333;}
	.info_box{width: 690upx;padding:30upx 0;box-sizing: border-box;border-top: 2upx solid #EEEEEE;margin-left: 30upx;}
	.font_item{min-height: 60upx;}
</style>
